﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterCustomerLogin.master" AutoEventWireup="true" CodeBehind="ShowOrderList.aspx.cs" Inherits="Project_Udrinkwater.CustomerLogin.ShowOrderList" %>
<%@ Register TagPrefix="dxwschs" Namespace="DevExpress.Web.ASPxScheduler" Assembly="DevExpress.Web.ASPxScheduler.v12.2, Version=12.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" %>
<%@ Register TagPrefix="dxpc" Namespace="DevExpress.Web.ASPxPopupControl" Assembly="DevExpress.Web.v12.2, Version=12.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" %>
<%@ Register TagPrefix="dxe" Namespace="DevExpress.Web.ASPxEditors" Assembly="DevExpress.Web.v12.2, Version=12.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <dx:ASPxRoundPanel ID="RPN_ShowOrderLogin" runat="server" Width="100%" 
        HeaderText="รายการสั่งซื้อ">
        <HeaderStyle Font-Size="Medium" HorizontalAlign="Left" />
        <PanelCollection>
<dx:PanelContent runat="server" SupportsDisabledAttribute="True">
      <div align="center">
        <div align="left">
            <dxe:ASPxButton runat="server" Text="บันทึกการสั่งซื้อ" Width="107px" 
                ID="bt_InsertData" OnClick="bt_InsertData_Click" Theme="Youthful">
<ClientSideEvents Click="function(s,e) { e.processOnServer = confirm('ยืนยันการสั่งซื้อสินค้า&#39'); }"></ClientSideEvents>
</dxe:ASPxButton>

          
          </div>
       <dx:ASPxGridView ID="GV_OrderList" runat="server" AutoGenerateColumns="False" 
            Width="100%" Font-Size="Medium"  KeyFieldName="Number"
            oncustomunboundcolumndata="GV_OrderList_CustomUnboundColumnData" 
            onrowcommand="GV_OrderList_RowCommand" >
           <TotalSummary>
<dx:ASPxSummaryItem SummaryType="Sum" FieldName="TotalRow" DisplayFormat="รวม {0:#,###.00}"></dx:ASPxSummaryItem>
           </TotalSummary>
        <Columns>
            <dx:GridViewDataTextColumn FieldName="Goods_ID" VisibleIndex="2" 
                Caption="รหัสสินค้า">
                <HeaderStyle HorizontalAlign="Center" />
                <CellStyle HorizontalAlign="Center">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Goos_Name" VisibleIndex="3" 
                Caption="สินค้า">
                <HeaderStyle HorizontalAlign="Center" />
                <CellStyle HorizontalAlign="Center">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Price" VisibleIndex="4" Caption="ราคา">
                <HeaderStyle HorizontalAlign="Center" />
                <CellStyle HorizontalAlign="Center">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="PriceNumber" VisibleIndex="5" 
                Caption="จำนวนสินค้า">
                <HeaderStyle HorizontalAlign="Center" />
                <CellStyle HorizontalAlign="Center">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="รายการ" VisibleIndex="1" 
                UnboundType="String" FieldName="Number">
                <HeaderStyle HorizontalAlign="Center" />
                <CellStyle HorizontalAlign="Center">
                </CellStyle>
                <DataItemTemplate>
            <%#Container.ItemIndex +1 %> 
                </DataItemTemplate>

            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="TotalRow" UnboundType="Decimal" 
                VisibleIndex="7" Caption="รวม"> 
                <HeaderStyle HorizontalAlign="Center" />
                <CellStyle HorizontalAlign="Right">
                </CellStyle>
                <FooterCellStyle ForeColor="Black" HorizontalAlign="Right" />
               
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="ส่วนลด" FieldName="Discount" 
                VisibleIndex="6">
                <HeaderStyle HorizontalAlign="Center" />
                <CellStyle HorizontalAlign="Center">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn VisibleIndex="8">
                <DataItemTemplate>
                     <dx:ASPxButton ID="btnImageAndText" runat="server" CommandName="Cmd_Delete"  CommandArgument='<%# Container.ItemIndex %>' 
                Width="120px" Text="ลบรายการ" BackColor="White" >
                <Image Url="../images/Remove.png" Width="16px" Height="16px"></Image>
                <ClientSideEvents Click="function(s,e) { e.processOnServer = confirm('ยืนยันการลบสินค้า'); }" />
            </dx:ASPxButton>
                </DataItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
                <CellStyle HorizontalAlign="Center">
                </CellStyle>
            </dx:GridViewDataTextColumn>
        </Columns>
        <Settings ShowFooter="True" ShowGroupFooter="VisibleIfExpanded" />
        
           <SettingsBehavior ConfirmDelete="True" />
        
           <SettingsPager Mode="ShowAllRecords" >
           </SettingsPager>
           <SettingsText ConfirmDelete="ยืนยันการลบข้อมูล" />
    </dx:ASPxGridView> 
    </div>
</dx:PanelContent>
</PanelCollection>
    </dx:ASPxRoundPanel>
</asp:Content>
